﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ActivitiesControl.Domain.Utils
{
	public class Date
	{
		public int Year { get; set; }
		public int Month { get; set; }
		public int Day { get; set; }

		/// <summary>
		/// Hours, minutes, seconds will be ignored
		/// </summary>
		/// <param name="date"></param>
		public Date(DateTime date)
		{
			Year = date.Year;
			Month = date.Month;
			Day = date.Day;
		}

		public Date(int year, int month, int day)
		{
			Year = year;
			Month = month;
			Day = day;
		}

		public DateTime DateTime
		{
			get { return new DateTime(Year, Month, Day); }
		}

		public static bool operator >(Date a, Date b)
		{
			return a.DateTime > b.DateTime;
		}

		public static bool operator <(Date a, Date b)
		{
			return a.DateTime < b.DateTime;
		}

		public static bool operator >=(Date a, Date b)
		{
			return a.DateTime >= b.DateTime;
		}

		public static bool operator <=(Date a, Date b)
		{
			return a.DateTime <= b.DateTime;
		}

		public static bool operator ==(Date a, Date b)
		{
			return a.DateTime == b.DateTime;
		}

		public static bool operator !=(Date a, Date b)
		{
			return a.DateTime != b.DateTime;
		}
	}
}